package com.google.code.stalkernet.message;

/**
 * Abstract base class for implementations of {@link LeafIDsMessage}.
 *
 * @author Mikhail Vladimirov
 */
public abstract class AbstractLeafIDsMessage
    extends AbstractMessage implements LeafIDsMessage
{
    /**
     * {@inheritDoc}
     */
    @Override
    public MessageType getType ()
    {
        return MessageType.LEAF_IDS;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public <T> T accept (MessageVisitor <T> messageVisitor)
    {
        if (messageVisitor == null)
            throw new IllegalArgumentException ("Message visitor is null");

        return messageVisitor.visitLeafIDsMessage (this);
    }
}
